import {EventEmitter} from 'events';
import CheckSuccess from './CheckSuccess';
import CheckError from './CheckError';
import LoginSuccess from './LoginSuccess';
import LoginError from './LoginError';
import NoLogin from './NoLogin';
import Logout from './Logout';
//创建事件
var event = new EventEmitter(); 
event.on('cas.check.success',function({ticket,user}){
  CheckSuccess(ticket,user);
});

event.on('cas.check.error',function(data){
  CheckError(data);
});

event.on('cas.login.success',function(data){
  LoginSuccess(data);
})


event.on('cas.login.error',function(data){
  LoginError(data);
})

event.on('cas.nologin',function(){
  NoLogin();
});

event.on('cas.logout',function(data){
  Logout(data);
})


export default event;